<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	 <!--<meta name="viewport" content="width=device-width, initial-scale=1.0">-->
<!--<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">-->
	<title>报价单</title>
</head>
<style>
    h1{text-align: center;}
    #main {width: 800px;height: 200px;margin: 0 auto;border: 1px solid #ccc;}
    #main p {text-align: center;}
    #printBtn {display: inline-block;text-align: center;width:100%;line-height: 40px;cursor: pointer;}
    a{color:#000;text-decoration:none}

    /*报价单样式*/
    .kuang {
        border: 2px solid #000;
        min-width: 800px;
        color: #000
    }

    .kuang .titlee {
        height: 60px;
        line-height: 55px;
        text-align: center;
        font-size: 25px;
        font-weight: bold;
        border-bottom: 2px solid #000;
    }

    .kk {
        line-height: 30px;
        padding: 10px 0;
        font-size: 16px;
    }

    .kuang_xinxi {
        display: flex;
        justify-content: space-between;
        margin: 0 auto;
    }

    .kuang_list {
        display: flex;
    }

    .list_tit {
        width: 200px;
        text-align: right;
    }

    .list_cont {
        min-width: 300px
    }

    .table1 {
        border-top: 2px solid #000;
        border-bottom: 2px solid #000;
        width: 100%;
        border-collapse: collapse;
        font-size: 16px;
    }

    .table1 td {
        /*border-left: 1px solid #000;*/
        border-top: 2px solid #000;
        padding: 0 10px;
        height: 35px;
        line-height: 35px;
        box-sizing: border-box;
        width: 20%;
        text-align: center;
    }

    .heji {
        height: 35px;
        line-height: 35px;
        text-align: center;
        font-size: 18px;
        font-weight: bold;
    }

    .table2 {
        font-weight: bold;
        text-align: center;
        border-bottom: 0px;
    }

    .beizhu {
        padding-left: 10px;
        padding-top: 10px;
        padding-bottom: 20px;
    }

    .beizhu_cont p {
        line-height: 25px;
        margin: 0;
        text-indent: 25px
    }

    /*折扣样式*/
    .list {
        display: flex;
        margin-bottom: 30px;
    }

    .list .list_name {
        width: 150px;
        text-align: right;
        margin-right: 10px;
    }

    .jiajian {
        display: flex;
        border: 1px solid #ccc;
        border-radius: 5px;
    }

    .jiajian_input, .jia, .jian, .jia2, .jian2 {
        height: 30px;
        line-height: 30px;
        text-align: center;
        width: 100px
    }

    .jiajian_input input, .jiajian_input2 input {
        border: 0;
        text-align: center;
        outline: none;
    }

    .jia, .jia2 {
        border-left: 1px solid #ccc;
        background: #ccc;
        width: 30px;
        cursor: pointer;
        font-size: 20px;
    }

    .jian, .jian2 {
        border-right: 1px solid #ccc;
        background: #ccc;
        width: 30px;
        cursor: pointer;
        font-size: 20px;
    }
    .kuang_xinxi{
        border: 1px solid;
        border-top: 0;
    }
    .list_tit{
        text-align: left;
        border-right: 1px solid;
        box-sizing: border-box;
        padding-left: 20px;
    }
    .list_cont {
        padding-left: 10px;
        box-sizing: border-box;
    }
    .leftborder{
        border-left: 1px solid ;
    }
    .textleft{
        text-align: left;
    }
</style>


<style>
    #zhifubao_er,#jiaofei_success{
        display:none;
    }
    #zhifu2{
        display:none;
    }
    #tongchou22{
        display: none;
    }
    .fuzhi_btn{
        height:30px;
        line-height:30px;
        text-align:center;
        background:#3683D3;
        color:#fff;
        border-radius:4px;
        width:140px;
        margin-top:20px;
        cursor: pointer;
    }
    .weixin_btn{
        background:green;
    }
    .zhifu_top{
        width: 40%;
        margin:0 auto;
        display: flex;
        align-items: center;
    }
    .jiao_namee{
        line-height: 20px;
        width: 200px;
    }
    .zhifu_top .zhi_tab,.tongchou{
        display:flex;
    }
    .zhi_tab .zhi_tablist,.zhi_tablist2,.tongchou_tab{
        padding:5px 10px;
        border:1px solid #ccc;
        margin-right: 15px;
        cursor:pointer
    }
    .zhi_tablist.active{
        border-color:blue;
        color:blue;
    }
    .zhi_tablist2.active{
        border-color:red;
        color:red;
    }
    .tongchou_tab.active{
        border-color:blue;
        color:blue;
    }
    .zhifu_cont{
        display: flex;
        width: 50%;
        margin:10px auto;
        justify-content: space-between;
        align-items: center;
    }
    .cont_list{
        line-height: 30px;
        display:flex;
        align-items: center;
        width:300px
    }
    .cont_list .zhifu_tt{
        width:80px;
        text-align-last: justify;
    }
    .cont_right{
        /*   width:120px;
           height: 120px; */
        border:1px solid #ccc;
        margin-left:30px;
        /*background:red;*/
    }
    .cont_right img{
        width: 100%;
        height: 120px;
    }
    .kuang .titlee {
    height: 60px;
    line-height: 55px;
    text-align: center;
    font-size: 25px;
    font-weight: bold;
    border-bottom: 2px solid #000;
}
    .table1 {
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}
    .table1 td{
        border-top: 2px solid #000;
    padding: 0 10px;
    height: 35px;
    line-height: 35px;
    box-sizing: border-box;
    width: 20%;
    text-align: center;
    }
    .timee {
        position: absolute;
        right: 10px;
        bottom: -15px;
        font-size: 14px;
        font-weight: 400;
    }
    .kuang {
        border: 2px solid #000;
        min-width: 800px;
        color: #000;
    }
    .kk {
    line-height: 30px;
    padding: 10px 0;
    font-size: 16px;
}
#ii{
    position: absolute;
        left: 35%;
    top: 10px;
    background: blue;
    color: #fff;
    padding: 5px 10px;
    border-radius: 8px;
}
</style>
<script src="html2canvas.min.js"></script>
<body>
  
	<div id="ii">点击生成图片</div>
	
	<div style=" margin-left:-266px;margin-top:-160px">
	     
	    	<div id="baojiadan" style="width:900px;margin:0px auto;padding:30px;box-sizing: border-box;transform:scale(0.4);">
	    <!-- 你的HTML内容 -->
		<div class="modal-body" style="width:100%;margin:0px auto;">
		    <div class="kuang" style="border:0px">
		        <!--<div class="titlee"><img style="width:50px;margin-right:5px" src="/static/logo.png" title="1641541697419545.png" alt="图片1.png">茗洲服务报价单</div>-->
		        <!--<div class="titlee" id="logos">-->
		        <!--    <img style="width:50px;margin-right:5px" src="/static/logo.png" title="1641541697419545.png"-->
		        <!--         alt="图片1.png">茗延安全服务商业报价单-->
		        <!--</div>-->
		        <!--<div style="font-size:50px;color:#fff;background:url(/static_gs_hn/bj1.png);    background-size: 100%;box-sizing: border-box;padding-left: 20px;">-->
		        <!--    天平联合汽车服务-->
		        <!--</div>-->
		        <div>
		             <img src="../assets/img/bao.png" alt="" style="width:100%" mode="widthFix" />
		        </div>
		       
		        <div style="display:flex;justify-content:space-between;width:95%;margin:0 auto;">
		            <div style="width:88%;">
		               <div style="font-size:35px;color:#0909e3;  font-weight:bold;  padding-left: 50px;">
		                   服务报价单
		               </div>
		               <div style="font-size:15px;padding-left: 63px;border-bottom:2px solid #ccc;position:relative;">
		                   <div style="width:50px;height:2px;background:blue;position:absolute;left:0;bottom:-2px">
		                       
		                   </div>
		                   SERVICE QUOTATION
		               </div>
		            </div>
		            <div style="margin-top: -30px;margin-left: 25px;">
		                 <img style="width:100px;" src="/logo1.png" alt="" />
		            </div>
		        </div>
		        <!--<div style="display:flex;justify-content:space-between;align-items:center;width:55%;margin:0 auto;">-->
		        <!--    <div>-->
		        <!--        <img style="width:100px;" src="/static_gs_hn/tu.jpg" alt="" />-->
		        <!--    </div>-->
		        <!--    <div style="font-size:28px;">-->
		        <!--        天平联合汽车服务-->
		        <!--    </div>-->
		        <!--    <div>-->
		        <!--        <img style="width:80px;height:80px;" src="/static_gs_hn/ewm.jpg" alt="" />-->
		        <!--    </div>-->
		        <!--</div>-->
		        <!--border-top: 2px solid #3683d3;-->
		        <!--padding-top: 20px;-->
		        <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;">
		            <div style="color:blue;font-weight:bold;font-size:20px">
		                我们衷心感谢您的询价，为您的爱车提供安全保障服务
		            </div>
		            <div style="font-size:16px;color:red">
		                服务电话：400-0863-063
		            </div>
		        </div>
		        <!--border-radius:4px 20px 4px 4px;-->
		        <div style="background:blue;color:#fff;padding:8px;display:inline-block;padding-right:15px">
		            基本信息
		        </div>
		        <div class="kk" style="padding:0;border-top: 1px solid;margin-top: 10px;">
		            <div class="kuang_xinxi">
		                <div class="kuang_list">
		                    <div class="list_tit">车牌号码</div>
		                    <div class="list_cont" id="car_num"></div>
		                </div>
		                <div class="kuang_list leftborder">
		                    <div class="list_tit">被服务人</div>
		                    <div class="list_cont" id="car_owner"></div>
		                </div>
		
		
		            </div>
		            <div class="kuang_xinxi">
		                <div class="kuang_list">
		                    <div class="list_tit">车架号</div>
		                    <div class="list_cont" id="chejiahao"></div>
		                </div>
		                <div class="kuang_list leftborder" >
		                    <div class="list_tit">发动机号</div>
		                    <div class="list_cont" id="fadongji"></div>
		                </div>
		
		            </div>
		            <div class="kuang_xinxi">
		                <div class="kuang_list">
		                    <div class="list_tit">车型</div>
		                    <div class="list_cont" id="chexing"></div>
		                </div>
		                <div class="kuang_list leftborder">
		                    <div class="list_tit">使用性质</div>
		                    <div class="list_cont" id="car_use_nature_nr"></div>
		                </div>
		            </div>
		            <div class="kuang_xinxi">
		                <div class="kuang_list">
		                    <div class="list_tit">初登日期</div>
		                    <div class="list_cont" id="car_register">2022-01-12</div>
		                </div>
		                <div class="kuang_list leftborder">
		                    <div class="list_tit">出险次数</div>
		                    <div class="list_cont" id="car_lastyear"></div>
		                </div>
		            </div>
		            <!--<div class="kuang_xinxi">-->
		            <!--    <div class="kuang_list">-->
		            <!--        <div class="list_tit">服务期限</div>-->
		            <!--        <div class="list_cont" id="plan_strattime"></div>-->
		            <!--    </div>-->
		            <!--</div>-->
		            <!--<div class="kuang_xinxi">-->
		            <!--    <div class="kuang_list">-->
		            <!--        <div class="list_tit">车辆类型</div>-->
		            <!--        <div class="list_cont" id="car_check_res"></div>-->
		            <!--    </div>-->
		            <!--</div>-->
		
		        </div>
		        <!--#3683D3-->
		        <!--border-radius:4px 20px 4px 4px;-->
		        <div style="background:blue;color:#fff;padding:8px;display:inline-block;padding-right:15px;margin-top:30px;margin-bottom:10px">
		            服务项目明细
		        </div>
		        <table class="table1" border="0" id="xiangmu" style="border:2px solid">
		            <tr style="">
		                <td>服务项目</td>
		                <td style="border-left: 2px solid #000;">服务金额(元)</td>
		                <td style="border-left: 2px solid #000;">标准服务费</td>
		            </tr>
		            <tr>
		                <td>机动车损失服务</td>
		                <td style="border-left: 2px solid #000;">11000</td>
		                <td style="border-left: 2px solid #000;">3330</td>
		            </tr>
		            <tr>
		                <td>机动车第三者责任服务</td>
		                <td style="border-left: 2px solid #000;">11000</td>
		                <td style="border-left: 2px solid #000;">3330</td>
		            </tr>
		            <tr>
		                <td>标准服务费</td>
		                <td colspan="2" style="border-left: 1px solid #000;">11000</td>
		            </tr>
		            <tr>
		                <td>折扣：</td>
		                <td colspan="2" style="border-left: 1px solid #000;">50%</td>
		            </tr>
		            <tr>
		                <td>折后服务费：</td>
		                <td colspan="2" style="border-left: 1px solid #000;">566</td>
		            </tr>
		            <tr style="background:#3683D3;color:#fff">
		                <td>附加服务项目</td>
		                <td style="border-left: 2px solid #000;">服务金额（元）</td>
		                <td style="border-left: 2px solid #000;">标准服务费</td>
		            </tr>
		            <tr>
		                <td>医保外用药</td>
		                <td style="border-left: 2px solid #000;">11000</td>
		                <td style="border-left: 2px solid #000;">3330</td>
		            </tr>
		            <tr>
		                <td>应缴服务费</td>
		                <td colspan="2" style="border-left: 2px solid #000;">12154</td>
		            </tr>
		            <!--<tr>-->
		            <!--	<td>服务项目</td>-->
		            <!--	<td style="border-left: 1px solid #000;">服务额(元)</td>-->
		            <!--	<td style="border-left: 1px solid #000;">标准服务费</td>-->
		            <!--	<td style="border-left: 1px solid #000;">折扣(%)</td>-->
		            <!--	<td style="border-left: 1px solid #000;">标准服务费(元)</td>-->
		            <!--</tr>-->
		            <!--<tr>-->
		            <!--	<td>第三者责任服务</td>-->
		            <!--	<td style="border-left: 1px solid #000;"></td>-->
		            <!--	<td style="border-left: 1px solid #000;"></td>-->
		            <!--</tr>-->
		
		        </table>
		        <div class="heji" style="display:none">合计</div>
		        <table class="table1 table2" border="0" style="display:none">
		            <tr>
		                <td>标准服务费合计(元)</td>
		                <!--<td style="border-left: 1px solid #000;">折扣(%)</td>-->
		                <td style="border-left: 1px solid #000;">应缴服务费(元)</td>
		            </tr>
		            <tr>
		                <td id="main_sum"></td>
		                <!--<td style="border-left: 1px solid #000;" id="main_sumdiscount"></td>-->
		                <td style="border-left: 1px solid #000;" id="main_free"></td>
		            </tr>
		        </table>
		    </div>
		    <div class="beizhu" style="display:none">
		        <div class="beizhu_tit">备注：</div>
		        <div class="beizhu_cont">
		            <br>
		            <br>
		            <p>
		                验车要求:车身前后左右45°角共4张照片拍全车身、1张车架号照，发动机照片（打着火的仪表盘），人车合影共7张，每张照片上附当日验车码。</p>
		            <!-- <p>(2)验车要求：车身前后左右45度角验车要求：车身前后左右45度角验车要求：车身前后左右45度角验车要求：车身前后左右45度角</p> -->
		            <p></p>
		            <p></p>
		            <p></p>
		            <div></div>
		        </div>
		    </div>
		    <div style="display:flex">
		        <div>
		            报价日期：<span id="bjrq"></span>
		        </div>
		        <div style="margin-left:30px">
		            报价人：<span id="bjr"></span>
		        </div>
		    </div>
		    <div>
		        <img src="../assets/img/bao.png" alt="" style="width:100%;margin-top:10px;transform: rotate(-180deg);" />
		    </div>
		    
		</div>
	</div>
	</div>

	 <div class="model">
		<div>
		    <img id="imgg" src="" alt="" mode="widthFix">
		</div>
		<div style="color:red">
		    长按图片保存
		</div>
		<div class="close" id="close_model">
		    关闭
		</div>
		    
	</div> 
</body>
<style type="text/css" media="all">
    .model{
        background:rgba(0,0,0,0.5);
        position: fixed;
        left: 0;
        top:0;
        width:100%;
        height:100vh;
        z-index: 1;
        display: none;
            text-align: center;
    padding-top: 200px;
        
    }
    .model .close{
        background:blue;
        color:#fff;
        padding:5px 10px;
        border-radius: 10px;
        display: inline-block;
    margin-top: 22px;
    }
    #imgg{
        position: relative;
        z-index: 99;
        width:350px;
    }
</style>
<script type="text/javascript" charset="utf-8" src="jquery-3.2.1.min.js">
    
</script>
<script>
		var dianji=document.getElementById("ii")
		console.log(dianji)
		dianji.addEventListener('click',function(){
			console.log(12121)
		
			html2canvas(document.querySelector("#baojiadan")).then(canvas => {
			    // 将canvas转换为图片
			    const imgData = canvas.toDataURL('image/png');
			    // 创建一个新的a元素并模拟点击以保存图片
			    const link = document.createElement('a');
			    link.download = 'baojiadan.png';
			    link.href = imgData;
			 //   var pp=document.getElementById("pp")
			 //   pp.href=imgData
			    	    // link.click();
			 //   window.postMessage({ type: 'download', url: imgData });
		
			    
				var imgg=document.getElementById("imgg")
				imgg.src=imgData
				var model=document.querySelector(".model")
				model.style.display='block'
				// console.log(imgData)
			});
		})
	var closee=document.getElementById("close_model")	
	
			closee.addEventListener('click',function(){
			    var model=document.querySelector(".model")
				model.style.display='none'
			})
window.onload = function() {
    console.log('页面加载完成');
    // 在这里写你的代码
    // 假设当前URL是 http://example.com/?name=John&age=30
const urlParams = new URLSearchParams(window.location.search);
const id = urlParams.get('id'); // 获取id参数的值
const token = urlParams.get('token'); // 获取id参数的值
console.log(id,token);
 baojia(id,token)
 
}
	function baojia(id,token){
		$.ajax({
	        url: "https://tc.niutuwangluo.com/api/order/order_detail",
	        dataType: 'json',
	        type: 'POST',
	        data:{'id':id,'token':token},
	        success: function (res) {
	        console.log(res)
	        $("#car_num").html(res.data.car_num)//车牌号码：
	        $("#car_owner").html(res.data.car_owner)//车主：
	        var chexing = res.data.chexing;
	        if(chexing == "网约车"){
	            chexing = "网约或出租";
	        }
	        
	        if(chexing == "2吨以下"){
	            chexing = "2吨以下货车";
	        }
	        
	        if(chexing == "6座以下"){
	            chexing = "6座以下(私家车)";
	        }
	        if(chexing == "6-10座"){
	            chexing = "6-10座(私家车)";
	        }
	        if(chexing == "货车"){
	            chexing = "2吨以上货车";
	        }
	        $("#chexing").html(chexing)//车型：
			
			 $("#car_use_nature_nr").html(res.data.car_use_nature_nr)//使用性质
	        $("#learned_name").html(res.data.car_use_natures)//被服务人：
	        $("#car_num").html(res.data.car_num)//车牌号码：
	
	        $("#chejiahao").html(res.data.car_vin)//车架号：
	        $("#fadongji").html(res.data.car_engine)//发动机号：
	
	        if (res.data.car_lastyear == 0) {
	            var car_lastyear = '0次'
	        } else if (res.data.car_lastyear == 1) {
	            var car_lastyear = '一次'
	        } else if (res.data.car_lastyear == 2) {
	            var car_lastyear = '二次'
	        } else if (res.data.car_lastyear == 3) {
	            var car_lastyear = '三次及以上'
	        } else if (res.data.car_lastyear == 4) {
	            var car_lastyear = '无状态'
	        } else if (res.data.car_lastyear == 5) {
	            var car_lastyear = '过户'
	        }
	        if (res.data.ncd == '新车') {
	            var ncd = '新车(含车损)'
	        } else if (res.data.ncd == '0次') {
	            var ncd = '0次(含车损)'
	        } else if (res.data.ncd == '出险1次') {
	            var ncd = '出险1次(含车损)'
	        } else if (res.data.ncd == '出险2次') {
	            var ncd = '出险2次(含车损)'
	        } else if (res.data.ncd == '出险3次') {
	            var ncd = '出险3次(含车损)'
	        } else if (res.data.ncd == '出险3次以上') {
	            var ncd = '出险3次以上(含车损)'
	        } else {
	            var ncd = res.data.ncd
	        }
	
	        $("#car_lastyear").html(ncd)//上年保险公司出险次数
	
	
	        if (res.data.car_check == 1) {
	            var car_check = '需要验车';
	        } else if (res.data.car_check == 2) {
	            var car_check = '免验车';
	        } else {
	            var car_check = '';
	        }
	        var car_check = res.data.chexing;
	        $("#car_register").html(res.data.car_register)
	
	        $("#car_check_res").html(car_check)//验车提示：
	        $("#plan_strattime").html("自" + res.data.plan_strattime + " 起至 " + res.data.plan_endtime + " 止")//服务期限：
	
	
	        $("#main_sum").html(res.data.main_sum)//标准服务费合计(元)		
	        $("#main_sumdiscount").html(res.data.main_sumdiscount)//折扣
	        $("#main_free").html(res.data.main_free)//应缴服务费(元)
	        if (res.data.gs_type == 2) {
	            var nr = '<img style="width:50px;margin-right:5px" src="/static_gs/logo.png" title="1641541697419545.png" alt="图片1.png"><?php  echo model("Constants")->gs[2];?>';
	            $("#logos").html(nr)
	            console.log(123)
	        } else if (res.data.gs_type == 3) {
	            var nr = '<img style="width:50px;margin-right:5px" src="/static_new/logo.png" title="1641541697419545.png" alt="图片1.png"><?php  echo model("Constants")->gs[3];?>';
	            $("#logos").html(nr)
	            console.log(123)
	        } else if (res.data.gs_type == 4) {
	            var nr = '<img style="width:50px;margin-right:5px" src="/static_tb/logo.png" title="1641541697419545.png" alt="图片1.png"><?php  echo model("Constants")->gs[4];?>';
	            $("#logos").html(nr)
	            console.log(123)
	        }else if (res.data.gs_type == 5) {
	            var nr = '<img style="width:50px;margin-right:5px" src="/static_gs_hn/logo.png" title="1641541697419545.png" alt="图片1.png"><?php  echo model("Constants")->gs[5];?>';
	            $("#logos").html(nr)
	            console.log(123)
	        }else if (res.data.gs_type == 6) {
	            var nr = '<img style="width:50px;margin-right:5px" src="/static_anxing/logo.png" title="1641541697419545.png" alt="图片1.png"><?php  echo model("Constants")->gs[6];?>';
	            $("#logos").html(nr)
	            console.log(123)
	        }else if (res.data.gs_type == 7) {
	            var nr = '<img style="width:50px;margin-right:5px" src="/static_dadi/logo.png" title="1641541697419545.png" alt="图片1.png"><?php  echo model("Constants")->gs[6];?>';
	            $("#logos").html(nr)
	            console.log(123)
	        } else {
	            var nr = '<img style="width:50px;margin-right:5px" src="/static/logo.png" title="1641541697419545.png" alt="图片1.png"><?php  echo model("Constants")->gs[1];?>';
	            console.log(345)
	            $("#logos").html(nr)
	        }
	
	        //服务项目
	        // 	var tongchou = `<tr>
	        // 						<td>服务项目</td>
	        // 						<td style="border-left: 1px solid #000;">服务额(元)</td>
	        //         							<td style="border-left: 1px solid #000;">标准服务费(元)</td>
	        //         							<td style="border-left: 1px solid #000;">折扣(%)</td>
	        //         							<td style="border-left: 1px solid #000;">应缴服务费(元)</td>
	        // 					</tr>`;
	        var tongchou = `<tr style="">
	    							<td style="">服务项目</td>
	    							<td style="border-left: 2px solid #000;">服务责任限额</td>
	    							<td style="border-left: 2px solid #000;">标准服务费</td>
	    							<td style="border-left: 2px solid #000;">折后服务费</td>
	    						</tr>`
	        //机动车损失服务
	        if (res.data.main_name == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>机动车车损服务</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.main_money+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.main_standard+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.main_discount+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.main_submit+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
	    							<td style="text-align:left;">机动车车损</td>
	    							<td style="border-left: 2px solid #000;">` + res.data.main_money + `</td>
	    							<td style="border-left: 2px solid #000;">` + res.data.main_standard + `</td>
	    							<td style="border-left: 2px solid #000;">` + res.data.main_submit + `</td>
	    						</tr>`
	        }
	        //机动车第三者责任服务
	        if (res.data.main_santong == 3000000) {
	            var main_santong = '300万'
	        } else if (res.data.main_santong == 2000000) {
	            var main_santong = '200万'
	        } else if (res.data.main_santong == 1500000) {
	            var main_santong = '150万'
	        } else if (res.data.main_santong == 1000000) {
	            var main_santong = '100万'
	        } else if (res.data.main_santong == 500000) {
	            var main_santong = '50万'
	        } else if (res.data.main_santong == 300000) {
	            var main_santong = '30万'
	        } else if (res.data.main_santong == 200000) {
	            var main_santong = '20万'
	        } else if (res.data.main_santong == 100000) {
	            var main_santong = '10万'
	        } else if (res.data.main_santong == 50000) {
	            var main_santong = '5万'
	        }
	        if (res.data.main_disan == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>机动车第三者责任服务</td>
	            // 						<td style="border-left: 1px solid #000;">`+main_santong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.main_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.main_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.main_yingjiao+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
									<td style="text-align:left;">机动车第三者责任</td>
									<td style="border-left: 2px solid #000;">` + res.data.main_santong + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.main_biao + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.main_yingjiao + `</td>
								</tr>`
	        }
	
	        //车上人员责任服务(司机)
	        if (res.data.siji_tong == 10000) {
	            var siji_tong = '1万'
	        } else if (res.data.siji_tong == 20000) {
	            var siji_tong = '2万'
	        } else if (res.data.siji_tong == 30000) {
	            var siji_tong = '3万'
	        } else if (res.data.siji_tong == 40000) {
	            var siji_tong = '4万'
	        } else if (res.data.siji_tong == 50000) {
	            var siji_tong = '5万'
	        } else if (res.data.siji_tong == 60000) {
	            var siji_tong = '6万'
	        } else if (res.data.siji_tong == 70000) {
	            var siji_tong = '7万'
	        } else if (res.data.siji_tong == 80000) {
	            var siji_tong = '8万'
	        } else if (res.data.siji_tong == 90000) {
	            var siji_tong = '9万'
	        } else if (res.data.siji_tong == 100000) {
	            var siji_tong = '10万'
	        } else if (res.data.siji_tong == 200000) {
	            var siji_tong = '20万'
	        } else if (res.data.siji_tong == 300000) {
	            var siji_tong = '30万'
	        } else if (res.data.siji_tong == 500000) {
	            var siji_tong = '50万'
	        }
	        if (res.data.siji == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>车上人员责任服务(司机)</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.siji_tong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.siji_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.siji_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.siji_ying+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
									<td style="text-align:left;">车上人员责任(司机)</td>
									<td style="border-left: 2px solid #000;">` + res.data.siji_tong + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.siji_biao + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.siji_ying + `</td>
								</tr>`
	        }
	        //车上人员责任保险(乘客)
	        console.log(res.data.ck_money)
	        if (res.data.ck_money == 10000) {
	            var ck_money = '1万'
	        } else if (res.data.ck_money == 20000) {
	            var ck_money = '2万'
	        } else if (res.data.ck_money == 30000) {
	            var ck_money = '3万'
	        } else if (res.data.ck_money == 40000) {
	            var ck_money = '4万'
	        } else if (res.data.ck_money == 50000) {
	            var ck_money = '5万'
	        } else if (res.data.ck_money == 60000) {
	            var ck_money = '6万'
	        } else if (res.data.ck_money == 70000) {
	            var ck_money = '7万'
	        } else if (res.data.ck_money == 80000) {
	            var ck_money = '8万'
	        } else if (res.data.ck_money == 90000) {
	            var ck_money = '9万'
	        } else if (res.data.ck_money == 100000) {
	            var ck_money = '10万'
	        } else if (res.data.ck_money == 200000) {
	            var ck_money = '20万'
	        }
	        if (res.data.chengke == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>车上人员责任保险(乘客)`+ck_money+`元/座`+res.data.chengke_zuo+`座</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.ck_tong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.ck_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.ck_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.ck_ying+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
									<td style="text-align:left;">车上人员责任(乘客)</td>
									<td style="border-left: 2px solid #000;">`+res.data.ck_money+'*' + res.data.chengke_zuo +`</td>
									<td style="border-left: 2px solid #000;">` + res.data.ck_biao + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.ck_ying + `</td>
								</tr>`
	        }
	
	
	        //自燃损失服务
	        if (res.data.ziran == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>自燃损失服务</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.zi_tong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.zi_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.zi_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.zi_ying+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
									<td style="text-align:left;">外部电网故障损失</td>
									<td style="border-left: 2px solid #000;">` + res.data.zi_tong + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.zi_biao + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.zi_ying + `</td>
								</tr>`
	        }
	        //发动机涉水损失服务
	        if (res.data.fdjsunshi == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>发动机涉水损失服务</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.fdj_tong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.fdj_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.fdj_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.fdj_ying+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
									<td style="text-align:left;">` + res.data.fd_c + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.fdj_tong + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.fdj_ying + `</td>
								</tr>`
	        }
	        //指定修理厂服务
	        if (res.data.zdxiuli == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>指定修理厂服务</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.zd_tong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.zd_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.zd_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.zd_ying+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
									<td style="text-align:left;">` + res.data.zd_c + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.zd_tong + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.zd_ying + `</td>
								</tr>`
	        }
	        //车上货物责任服务	
	        if (res.data.huowu == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>车上货物责任服务</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.hw_tong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.hw_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.hw_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.hw_ying+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
									<td style="text-align:left;">` + res.data.huowu_c + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.hw_tong + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.hw_biao + `</td>
								</tr>`
	        }
	        //玻璃单独破碎服务
	        if (res.data.boli == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>玻璃单独破碎服务</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.bl_tong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.bl_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.bl_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.bl_ying+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
									<td style="text-align:left;">` + res.data.boli_c + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.bl_tong + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.bl_biao + `</td>
								</tr>`
	        }
	
	        if (res.data.dao_tong == 3000000) {
	            var dao_tong = '300万'
	        } else if (res.data.dao_tong == 2000000) {
	            var dao_tong = '200万'
	        } else if (res.data.dao_tong == 1500000) {
	            var dao_tong = '150万'
	        } else if (res.data.dao_tong == 1000000) {
	            var dao_tong = '100万'
	        } else if (res.data.dao_tong == 500000) {
	            var dao_tong = '50万'
	        } else if (res.data.dao_tong == 300000) {
	            var dao_tong = '30万'
	        } else if (res.data.dao_tong == 200000) {
	            var dao_tong = '20万'
	        } else if (res.data.dao_tong == 100000) {
	            var dao_tong = '10万'
	        } else if (res.data.dao_tong == 50000) {
	            var dao_tong = '5万'
	        } else {
	            var dao_tong = '-'
	        }
	        //三者医保外用药
	        if (res.data.dao_name == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>三者医保外用药</td>
	            // 						<td style="border-left: 1px solid #000;">`+dao_tong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.dao_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.dao_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.dao_ying+`</td>
	            // 					</tr>`
	            tongchou += `
	    						<tr>
									<td style="text-align:left;">医保外用药</td>
									<td style="border-left: 2px solid #000;">` + res.data.dao_tong + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.dao_biao + `</td>
									<td style="border-left: 2px solid #000;border-bottom: 2px solid #000;">` + res.data.dao_biao + `</td>
								</tr>`
	        }
	        //不计免赔服务
	        if (res.data.buji == 1) {
	            // 		tongchou += `<tr>
	            // 						<td>不计免赔服务</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.bu_tong+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.bu_biao+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.bu_zhe+`</td>
	            // 						<td style="border-left: 1px solid #000;">`+res.data.bu_ying+`</td>
	            // 					</tr>`
	            tongchou += `<tr>
									<td style="text-align:left;">不计免赔服务</td>
									<td style="border-left: 2px solid #000;">` + res.data.bu_tong + `</td>
									<td style="border-left: 2px solid #000;">` + res.data.bu_biao + `</td>
								</tr>`
	        }
	        // 	标准服务费（标准服务费合计-医保外用药标准服务费）
	        // 折后服务费（折后服务费：=应缴服务费 -dao_ying）
	        if (res.data.dao_name == 1) {
	            // var biaozhun=numSub(res.data.main_sum,res.data.dao_biao)
	            // var zhehou=numSub(res.data.main_free,res.data.dao_ying)
	            var biaozhun = res.data.main_sum
	            var zhehou = res.data.main_free
	        } else {
	            var biaozhun = res.data.main_sum
	            var zhehou = res.data.main_free
	        }
	//         tongchou += `<tr>
							// 	<td style="text-align:left;">标准服务费</td>
							// 	<td colspan="2" style="border-left: 2px solid #000;">` + biaozhun + `</td>
							// </tr>`
	//         tongchou += `<tr>
							// 	<td style="text-align:left;">折扣：</td>
							// 	<td colspan="2" style="border-left: 2px solid #000;">` + res.data.main_sumdiscount + `%</td>
							// </tr>`
	        // 	tongchou += `<tr>
	        // 					<td>折后服务费：</td>
	        // 					<td colspan="2" style="border-left: 2px solid #000;">`+zhehou+`</td>
	        // 				</tr>`
	        // 		$("#main_sum").html(res.data.main_sum)//标准服务费合计(元)		
	        // 	$("#main_sumdiscount").html(res.data.main_sumdiscount)//折扣
	        // 	$("#main_free").html(res.data.main_free)//应缴服务费(元)
	
	        // 	if(res.data.dao_tong == 3000000){
	        // 		var dao_tong = '300万'
	        // 	}else if(res.data.dao_tong == 2000000){
	        // 		var dao_tong = '200万'
	        // 	}else if(res.data.dao_tong == 1500000){
	        // 		var dao_tong = '150万'
	        // 	}else if(res.data.dao_tong == 1000000){
	        // 		var dao_tong = '100万'
	        // 	}else if(res.data.dao_tong == 500000){
	        // 		var dao_tong = '50万'
	        // 	}else if(res.data.dao_tong == 300000){
	        // 		var dao_tong = '30万'
	        // 	}else if(res.data.dao_tong == 200000){
	        // 		var dao_tong = '20万'
	        // 	}else if(res.data.dao_tong == 100000){
	        // 		var dao_tong = '10万'
	        // 	}else if(res.data.dao_tong == 50000){
	        // 		var dao_tong = '5万'
	        // 	}else{
	        // 	    var dao_tong = '-'
	        // 	}
	        // 	//三者医保外用药
	        // 	if(res.data.dao_name == 1){
	        // // 		tongchou += `<tr>
	        // // 						<td>三者医保外用药</td>
	        // // 						<td style="border-left: 1px solid #000;">`+dao_tong+`</td>
	        // // 						<td style="border-left: 1px solid #000;">`+res.data.dao_biao+`</td>
	        // // 						<td style="border-left: 1px solid #000;">`+res.data.dao_zhe+`</td>
	        // // 						<td style="border-left: 1px solid #000;">`+res.data.dao_ying+`</td>
	        // // 					</tr>`
	        // 		tongchou += `<tr style="background:#3683D3;color:#fff">
	        //         							<td>附加服务项目</td>
	        //         							<td style="border-left: 2px solid #000;">服务金额（元）</td>
	        //         							<td style="border-left: 2px solid #000;">标准服务费</td>
	        //         						</tr>
	        //         						<tr>
	        // 						<td>医保外用药</td>
	        // 						<td style="border-left: 2px solid #000;">`+dao_tong+`</td>
	        // 						<td style="border-left: 2px solid #000;">`+res.data.dao_biao+`</td>
	        // 					</tr>`
	        // 	}
	        tongchou += `<tr>
								<td colspan="2" style="text-align:left;">应缴服务费(元)：</td>
								
								<td colspan="1" style="border-left: 2px solid #000;"><p ">` + res.data.main_sum + `</p></td>
								<td colspan="1" style="border-left: 2px solid #000;"><p ">` + res.data.main_free + `</p></td>
							</tr>`
			
			if(!res.data.jq_price){
			    var jq_price=0.00
			}else{
			    var jq_price=res.data.jq_price
			}
			if(!res.data.cc_price){
			    var cc_price=0.00
			}else{
			    var cc_price=res.data.cc_price
			}
			var num11=numAdd(jq_price,cc_price)
			var hejii=numAdd(num11,res.data.main_free)
			tongchou += `<tr>
									<td colspan="2" style="text-align:left">折扣系数</td>
									<td colspan="2" style="border-left: 2px solid #000;">`+res.data.main_sumdiscount / 100+`</td>
								</tr>`
			
	        tongchou += `<tr>
									<td style="text-align:left;">交强险：` + jq_price + `</td>
									<td style="border-left: 2px solid #000;">车船税：` + cc_price + `</td>
									<td colspan="2" style="border-left: 2px solid #000;background:#f2f2f2;font-weight:bold">合计：`+hejii+`</td>
								</tr>`
								tongchou += `<tr>
								<td style="text-align:left;">备注</td>
								<td colspan="3" style="border-left: 2px solid #000;color:red;text-align:center">此报价优惠，仅限当日有效，最终价格以审核为准</td>
							</tr>`
			$("#bjrq").html(res.data.yw_join_time)
			$("#bjr").html(res.data.yw_belonger)
	        $("#xiangmu").html(tongchou)
	
	    }
	    })
	}
	
	function numAdd(num1, num2) {
	        var baseNum, baseNum1, baseNum2;
	        try {
	        baseNum1 = num1.toString().split(".")[1].length;
	        }catch (e) {
	        baseNum1 = 0;
	        }try {
	        baseNum2 = num2.toString().split(".")[1].length;
	        }catch (e) {
	        baseNum2 = 0;
	        }baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
	        return (num1 * baseNum + num2 * baseNum) / baseNum;
	    };
	// 		减法
	function numSub(num1, num2) {
	    var baseNum, baseNum1, baseNum2;
	    var precision;// 精度
	    try {
	    baseNum1 = num1.toString().split(".")[1].length;
	    }catch (e) {
	    baseNum1 = 0;
	    }try {
	    baseNum2 = num2.toString().split(".")[1].length;
	    }catch (e) {
	    baseNum2 = 0;
	    }baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
	    precision = (baseNum1 >= baseNum2) ? baseNum1 : baseNum2;
	    return ((num1 * baseNum - num2 * baseNum) / baseNum).toFixed(precision);
	};
</script>
</html>